package bankapp.get;

/**
 * @author
 * 
 * TodoDatabaseHelper helps in creating and updating Database. 
 */

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

public class TransHelper extends SQLiteOpenHelper {

    //defining the name of the database
    private static final String DATABASE_NAME = "transaction";

    //version of the database
    private static final int DATABASE_VERSION = 2;

    // Database creation sql statement
    
    private static final String DATABASE_CREATE = "create table transact (sno integer primary key autoincrement, "
        + "accid text not null, balance integer not null,desc text not null);";
    
                
    
    

    public TransHelper(Context context) {

        super(context, DATABASE_NAME, null, DATABASE_VERSION);
    }

    // Method is called during creation of the database
    @Override
    public void onCreate(SQLiteDatabase database) {

        database.execSQL(DATABASE_CREATE);
       
        
        
    }

    // Method is called during an upgrade of the database, e.g. if you increase
    // the database version
    @Override
    public void onUpgrade(SQLiteDatabase database, int oldVersion, int newVersion) {

        Log.w(TransHelper.class.getName(), "Upgrading database from version " + oldVersion + " to " + newVersion
                + ", which will destroy all old data");
        database.execSQL("DROP TABLE IF EXISTS todo");
        onCreate(database);
    }
}